home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac-Source 1994 July
/
Mac-Source_July_1994.iso
/
C and C++
/
Libraries
/
TransSkel
/
Demos
/
Pascal Demos
/
Button
/
Button.p
next >
Wrap
Text File
|
1994-02-23
|
1KB
|
74 lines
{ TransSkel button application in Pascal }
{ 10 Feb 94 Version 1.00, Paul DuBois }
program Button;
uses
TransSkel, ButtonGlobals, Dialog1, Dialog2, Dialog3, Document;
{--------------------------------------------------------------------}
{ Menu handling procedures }
{--------------------------------------------------------------------}
{ Handle selection of "About Button..." item from Apple menu }
procedure DoAppleMenu (item: Integer);
var
ignore: Integer;
begin
ignore := SkelAlert(aboutAlrtRes, SkelDlogFilter(nil, true), skelPositionOnParentDevice);
SkelRmveDlogFilter;
end;
{ Process selection from File menu }
procedure DoFileMenu (item: Integer);
const
doDialog1Item = 1;
doDialog2Item = 2;
doDialog3Item = 3;
{ sepLine }
quitAppItem = 5;
begin
case item of
doDialog1Item:
DoDialog1;
doDialog2Item:
DoDialog2;
doDialog3Item:
DoDialog3;
quitAppItem:
SkelStopEventLoop;
end;
end;
{ Initialize menus. Tell TransSkel to process the Apple menu }
{ automatically, and associate the proper procedures with the }
{ File menu. }
procedure SetupMenus;
var
m: MenuHandle;
ignore: Boolean;
begin
SkelApple('About Button…', @DoAppleMenu);
m := GetMenu(fileMenuRes);
ignore := SkelMenu(m, @DoFileMenu, nil, false, true);
end;
begin
SkelInit(nil);
horizRatio := FixRatio(1, 2);
vertRatio := FixRatio(1, 5);
SetupMenus;
SetupDocument;
SkelEventLoop;
SkelCleanup;
end.